<template>
  <common-crud ref="gDatasource" :crudOptionProps="crudOptionProps"></common-crud>
</template>

<script>
import commonCrud from "@/components/commonCrud/CommonCrud.vue"

export default {
  name: "gDatasource",
  components: {commonCrud},
  data() {
    return {
      // 表配置
      crudOptionProps: {
        name: '/generator/gDatasource',
        apiPrefix: '/generator/gDatasource',
        // 是否云原生
        // functionTarget: 'GDatasource',
        tableOption: {
          addBtn:true,
          column: [


            {
              label: "数据库类型",
              prop: "dbType",
              search: false,
              required: true,
              type: "select",
              dictType: "DB_TYPE"
            },


            {
              label: "连接名",
              prop: "connName",
              search: true ,
              required: true
            },


            {
              label: "连接的url",
              prop: "connUrl",
              search: false,
              required: true
            },


            {
              label: "用户名",
              prop: "username",
              search: false,
              required: true
            },


            {
              label: "密码",
              prop: "password",
              search: false,
              required: true,
              hide:true,
              type: "password"
            },


            // {
            //   label: "状态(0:启用,1:禁用)",
            //   prop: "status",
            //   search: false,
            //   required: false
            // },


          ]
        },
        buttonList: [
          {
            menuType: "menu", name: "连接测试", icon: "View", mode: 'switch', info: {
              url: "/generator/gDatasource/connTest",
              prop: "dict",
              param: {id: "$id", dict: 0},
              postType: 'get',
              successMsg: "测试成功",
              errorMsg: "测试失败"
            }
          },
        ]

      }

    }
  }, created() {

  }, computed() {

  }, methods: {}
}
</script>

<style scoped>

</style>
